package com.neu.cloudFactory.DAO;

import com.neu.cloudFactory.PO.Bid;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface BidDAO extends JpaRepository<Bid,Integer> {
    //带有CRUD接口
    List<Bid> findByOrderId(int id);

    //改变标的状态
    @Modifying
    @Query(value = "update bid set b_state = :curState where b_id = :curId", nativeQuery = true)
    void modifyState(@Param("curState") String curState, @Param("curId") int curId);

}
